package com.zjy.business.system.dao;

import com.zjy.business.system.domain.entity.SysUser;
import com.zjy.business.system.domain.manager.query.ManagerListPageSysUserQuery;
import com.zjy.business.system.domain.manager.vo.ManagerListPageSysUserVo;
import com.zjy.business.system.mapper.SysUserMapper;
import com.zjy.config.RedisServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author yxb
 * create_time: 2024-10-22 14:44
 * description: 
 */
@Service
public class SysUserDao extends RedisServiceImpl<SysUserMapper, SysUser> {
    public List<ManagerListPageSysUserVo> listPageSysUser(ManagerListPageSysUserQuery query) {
        return this.baseMapper.listPageSysUser(query);
    }

    /**
     * 根据菜单id获取用户id
     * @param menuId
     * @return
     */
    public List<Long> getUserIdByMenuId(Long menuId) {
        return this.baseMapper.getUserIdByMenuId(menuId);
    }

    /**
     * 根据角色id获取用户id
     * @param roleId 角色id
     * @return
     */
    public List<Long> getUserIdByRoleId(Long roleId) {
        return this.baseMapper.getUserIdByRoleId(roleId);
    }
}
